home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xml-rpc / nsIDictionary.h next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  189 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIDictionary.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIDictionary_h__
  6. #define __gen_nsIDictionary_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIDictionary */
  19. #define NS_IDICTIONARY_IID_STR "1dd0cb45-aea3-4a52-8b29-01429a542863"
  20.  
  21. #define NS_IDICTIONARY_IID \
  22.   {0x1dd0cb45, 0xaea3, 0x4a52, \
  23.     { 0x8b, 0x29, 0x01, 0x42, 0x9a, 0x54, 0x28, 0x63 }}
  24.  
  25. /**
  26.  * A simple mutable table of objects, accessed by key.
  27.  */
  28. class NS_NO_VTABLE nsIDictionary : public nsISupports {
  29.  public: 
  30.  
  31.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDICTIONARY_IID)
  32.  
  33.   /**
  34.      * Check if a given key is present in the dictionary.
  35.      *
  36.      * @param key       Key to check for
  37.      * @return          true if present, false if absent.
  38.      */
  39.   /* boolean hasKey (in string key); */
  40.   NS_IMETHOD HasKey(const char *key, PRBool *_retval) = 0;
  41.  
  42.   /**
  43.      * Retrieve all keys in the dictionary.
  44.      *
  45.      * @return          array of all keys, unsorted.
  46.      */
  47.   /* void getKeys (out PRUint32 count, [array, size_is (count), retval] out string keys); */
  48.   NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) = 0;
  49.  
  50.   /**
  51.      * Find the value indicated by the key.
  52.      *
  53.      * @param key       The lookup key indicating the value.
  54.      * @return          Value indicated by key. If the key doesn't exist,
  55.      *                  NS_ERROR_FAILURE will be returned.
  56.      */
  57.   /* nsISupports getValue (in string key); */
  58.   NS_IMETHOD GetValue(const char *key, nsISupports **_retval) = 0;
  59.  
  60.   /**
  61.      * Add the key-value pair to the dictionary.
  62.      * If the key is already present, replace the old value
  63.      * with the new.
  64.      *
  65.      * @param key       The key by which the value can be accessed
  66.      * @param value     The value to be stored.
  67.      */
  68.   /* void setValue (in string key, in nsISupports value); */
  69.   NS_IMETHOD SetValue(const char *key, nsISupports *value) = 0;
  70.  
  71.   /**
  72.      * Delete the indicated key-value pair.
  73.      *
  74.      * @param key       The key indicating the pair to be removed.
  75.      * @return          The removed value. If the key doesn't exist,
  76.      *                  NS_ERROR_FAILURE will be returned.
  77.      */
  78.   /* nsISupports deleteValue (in string key); */
  79.   NS_IMETHOD DeleteValue(const char *key, nsISupports **_retval) = 0;
  80.  
  81.   /**
  82.      * Delete all key-value pairs from the dictionary.
  83.      */
  84.   /* void clear (); */
  85.   NS_IMETHOD Clear(void) = 0;
  86.  
  87. };
  88.  
  89. /* Use this macro when declaring classes that implement this interface. */
  90. #define NS_DECL_NSIDICTIONARY \
  91.   NS_IMETHOD HasKey(const char *key, PRBool *_retval); \
  92.   NS_IMETHOD GetKeys(PRUint32 *count, char ***keys); \
  93.   NS_IMETHOD GetValue(const char *key, nsISupports **_retval); \
  94.   NS_IMETHOD SetValue(const char *key, nsISupports *value); \
  95.   NS_IMETHOD DeleteValue(const char *key, nsISupports **_retval); \
  96.   NS_IMETHOD Clear(void); 
  97.  
  98. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  99. #define NS_FORWARD_NSIDICTIONARY(_to) \
  100.   NS_IMETHOD HasKey(const char *key, PRBool *_retval) { return _to HasKey(key, _retval); } \
  101.   NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return _to GetKeys(count, keys); } \
  102.   NS_IMETHOD GetValue(const char *key, nsISupports **_retval) { return _to GetValue(key, _retval); } \
  103.   NS_IMETHOD SetValue(const char *key, nsISupports *value) { return _to SetValue(key, value); } \
  104.   NS_IMETHOD DeleteValue(const char *key, nsISupports **_retval) { return _to DeleteValue(key, _retval); } \
  105.   NS_IMETHOD Clear(void) { return _to Clear(); } 
  106.  
  107. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  108. #define NS_FORWARD_SAFE_NSIDICTIONARY(_to) \
  109.   NS_IMETHOD HasKey(const char *key, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasKey(key, _retval); } \
  110.   NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeys(count, keys); } \
  111.   NS_IMETHOD GetValue(const char *key, nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(key, _retval); } \
  112.   NS_IMETHOD SetValue(const char *key, nsISupports *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValue(key, value); } \
  113.   NS_IMETHOD DeleteValue(const char *key, nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteValue(key, _retval); } \
  114.   NS_IMETHOD Clear(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(); } 
  115.  
  116. #if 0
  117. /* Use the code below as a template for the implementation class for this interface. */
  118.  
  119. /* Header file */
  120. class nsDictionary : public nsIDictionary
  121. {
  122. public:
  123.   NS_DECL_ISUPPORTS
  124.   NS_DECL_NSIDICTIONARY
  125.  
  126.   nsDictionary();
  127.  
  128. private:
  129.   ~nsDictionary();
  130.  
  131. protected:
  132.   /* additional members */
  133. };
  134.  
  135. /* Implementation file */
  136. NS_IMPL_ISUPPORTS1(nsDictionary, nsIDictionary)
  137.  
  138. nsDictionary::nsDictionary()
  139. {
  140.   /* member initializers and constructor code */
  141. }
  142.  
  143. nsDictionary::~nsDictionary()
  144. {
  145.   /* destructor code */
  146. }
  147.  
  148. /* boolean hasKey (in string key); */
  149. NS_IMETHODIMP nsDictionary::HasKey(const char *key, PRBool *_retval)
  150. {
  151.     return NS_ERROR_NOT_IMPLEMENTED;
  152. }
  153.  
  154. /* void getKeys (out PRUint32 count, [array, size_is (count), retval] out string keys); */
  155. NS_IMETHODIMP nsDictionary::GetKeys(PRUint32 *count, char ***keys)
  156. {
  157.     return NS_ERROR_NOT_IMPLEMENTED;
  158. }
  159.  
  160. /* nsISupports getValue (in string key); */
  161. NS_IMETHODIMP nsDictionary::GetValue(const char *key, nsISupports **_retval)
  162. {
  163.     return NS_ERROR_NOT_IMPLEMENTED;
  164. }
  165.  
  166. /* void setValue (in string key, in nsISupports value); */
  167. NS_IMETHODIMP nsDictionary::SetValue(const char *key, nsISupports *value)
  168. {
  169.     return NS_ERROR_NOT_IMPLEMENTED;
  170. }
  171.  
  172. /* nsISupports deleteValue (in string key); */
  173. NS_IMETHODIMP nsDictionary::DeleteValue(const char *key, nsISupports **_retval)
  174. {
  175.     return NS_ERROR_NOT_IMPLEMENTED;
  176. }
  177.  
  178. /* void clear (); */
  179. NS_IMETHODIMP nsDictionary::Clear()
  180. {
  181.     return NS_ERROR_NOT_IMPLEMENTED;
  182. }
  183.  
  184. /* End of implementation class template. */
  185. #endif
  186.  
  187.  
  188. #endif /* __gen_nsIDictionary_h__ */
  189.